<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登录</title>
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/登录.css">
    <link rel="stylesheet" href="css/public.css">
    <link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.min.css">
</head>

<body>
    <header class="header">
        <div class="header_up">
            <h2>YOUR LOGO</h2>
            <span>用户登录</span>
        </div>
    </header>
    <div class="main" id="min">
        <div class="main_top">
            <span>当前位置：首页 > </span>
            <strong>登录</strong>
        </div>
    </div>
    <div class="main_con">
        <div class="main_con_img" id="main_con_img2">
            <img src="img/arvin-chingcuangco-1337415-unsplash.jpg" alt="">
        </div>
        <div class="main_con_iput">
            <h3>用户登录</h3>
            <!-- <form action="注册.html" method="GET"> -->
                <div class="main_con_iput_fir">
                    <p class="fir"><span class="fa fa-user"></span></p>
                    <input type="text" placeholder="请输入用户名/手机号" class="sec">
                </div>
                <div class="main_con_iput_two">
                    <p class="thre"><span class="fa fa-key"></span></p>
                    <input type="password" placeholder="请输入密钥" class="fou">
                </div>
                <p class="main_con_iput_thr">
                    <span class="fiv">忘记密码？</span>
                    <input type="button" value="登录" class="six">
                </p>

                <p class="main_con_iput_thr_end">
                    <span>or</span>
                    <input type="submit" value="立即注册" id="ip">
                </p>
            <!-- </form> -->
        </div>
    </div>
    <footer>
        <div class="footer_up">
            <div class="footer_up_con">
                <div class="footer_up_con_fir">
                    <p class="footer_up_con_fir1">
                        <a href="">联系我们</a>
                        <span>Content us</span>
                    </p>
                    <p class="footer_up_con_fir2">关注</p>
                    <p class="footer_up_con_fir3">您身边的家庭医生</p>
                </div>
                <div class="footer_up_con_two">
                    <div class="footer_up_con_two_img">
                        <span><img src="img/weibo.png" alt=""></span>
                        <span><img src="img/weixin.png" alt=""></span>
                        <span><img src="img/qq.png" alt=""></span>
                    </div>
                    <div class="footer_up_con_two_adress">
                        <p>地址: 北京市朝阳区国贸写字楼B座</p>
                        <p>电话: 400612358</p>
                        <p>邮箱: infor@abgj.com</p>
                    </div>
                    <div class="footer_up_con_two_phone">
                        <p>邮编: 400160</p>
                        <p>手机: 138466066</p>
                    </div>
                </div>

            </div>
        </div>
        <div class="footer_end">
            <p>京公网安备11010125610012号京ICP证150277号京ICP备15002532号</p>
        </div>
    </footer>
</body>
<script src="js/tools.js"></script>
</html>
<script>
    var oIP = document.getElementById('ip');
    oIP.onclick = function () {
        window.location.href = "注册.html";
    }
    var oMainConIput = document.getElementsByClassName('main_con_iput')[0];
    var oInput = oMainConIput.getElementsByTagName('input');
    oInput[2].onclick = function(){
        if(oInput[0].value == ''){
            alert('请输入用户名!');
        }else if(oInput[1].value == ''){
            alert('请输入密码!');
        }else{
            login();
        }
    }
    function login(){
        console.log(localStorage[oInput[0].value],oInput[1].value)
        if(localStorage[oInput[0].value] == oInput[1].value){
            addCookie('isLogin',oInput[1].value,10000000);
            alert('登录成功');
            localStorage.setItem("onload",true);
            window.location.href="./personal/index.html";
        }else{
            alert('用户名或密码错误')
        }
    }

</script>